//
//  TTVideoPlayViewController.m
//  ExhibitionHall
//
//  Created by 王洋 on 2019/6/16.
//  Copyright © 2019 王洋. All rights reserved.
//

#import <AVFoundation/AVFoundation.h>
#import <AVKit/AVKit.h>
#import "TTVideoPlayViewController.h"

@interface TTVideoPlayViewController ()


@end

@implementation TTVideoPlayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    //步骤1：获取视频路径
    NSString *webVideoPath = self.videoUrl;
    NSURL *webVideoUrl = [NSURL URLWithString:webVideoPath];
    //步骤2：创建AVPlayer
    AVPlayer *avPlayer = [[AVPlayer alloc] initWithURL:webVideoUrl];
    //步骤3：使用AVPlayer创建AVPlayerViewController，并跳转播放界面
    AVPlayerViewController *avPlayerVC =[[AVPlayerViewController alloc] init];
    avPlayerVC.player = avPlayer;
    [self presentViewController:avPlayerVC animated:YES completion:nil];
    
    [avPlayerVC.player play];

}



@end
